<me:UIAB50  x:Class="WPFExcelReport.TAB50RV"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
     xmlns:me="clr-namespace:WPFExcelReport"
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
    xmlns:WFS="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"  
     xmlns:YB="clr-namespace:WPFExcelReport;assembly=TGASTGA" 
     xmlns:AP="clr-namespace:WPFExcelReport;assembly=TAPKOPF" 
      xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT" 
      xmlns:GD="clr-namespace:WPFExcelReport;assembly=TGAAUF"  
      xmlns:GSC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR" 
     xmlns:AR="clr-namespace:WPFExcelReport;assembly=TABPR"
     xmlns:GB="clr-namespace:WPFExcelReport;assembly=TGLLG"  
     xmlns:GC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR" 
      xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"  
     xmlns:ZU="clr-namespace:WPFExcelReport;assembly=TZUTEI"  
      xmlns:MB="clr-namespace:WPFExcelReport;assembly=TGABEW"  
             xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
     Loaded="Window_Loaded"
     x:Name="TV" 
 >
    <me:UIAB50.Resources>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
    </me:UIAB50.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="2*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
             <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0"  Grid.Column="0">
            <WrapPanel >
                <WrapPanel  Visibility="{Binding IsGD,ElementName=TV,Converter={StaticResource bv}}" >
             <TextBlock Text="{Binding ABPAUFKRS}"/>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=-}}"/>
                    <TextBlock Text="{Binding ABPAUFLFD, Converter={StaticResource pnum}}"/>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=-}}"/>
                    <TextBlock Text="{Binding ABPAUFPOS, Converter={StaticResource pnum}}"/>
                </WrapPanel>
                <WrapPanel  IsEnabled="{Binding ERLKZ,ElementName=TV,Converter={StaticResource not}}" >
                    <Button Grid.Column="1" Height="20"  Width="24" Margin="0,10,0,0" 
                            Visibility="{Binding IsGD,ElementName=TV,Converter={StaticResource nbv}}" Click="btnPrePlan_Click">
                        <Button.Background>
                            <ImageBrush ImageSource="/ImagePackage;component/Images/Refresh.png" />
                        </Button.Background>
                    </Button>
                    <Button Grid.Column="1" Height="20"  Width="Auto" Margin="10,0,0,0" 
                            Content="{Binding Source={Localization:Translate Word=分批}}" 
                            Click="btnSplitBatch_Click"/>
                    <WFS:TBTNEXE CMD="AB50COMBINE" DLL="TABPOS" STWNW="MainWindow"
                                 KEY="{Binding KEY,ElementName=TV}"
                                 INFO="合投" IsInfo="True"  Margin="10,0,0,0" Height="30"
                                 />
                    <Button Grid.Column="1" Height="20"  Width="Auto" Margin="10,0,0,0"
                            />
                    <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=复板:}}"></TextBlock>
                    <Grid IsEnabled="{Binding ERLKZ,ElementName=TV,Converter={StaticResource not}}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="10,0,0,0"   IsEnabled="True" Click="FBStartCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-right.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=启动}}"></TextBlock>
                    </Grid>
                    <Grid IsEnabled="{Binding ERLKZ,ElementName=TV,Converter={StaticResource not}}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="10,0,0,0"   IsEnabled="True" Click="FBApproveCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=确认}}"></TextBlock>
                    </Grid>
                </WrapPanel>
                <WrapPanel>
                    <Grid Visibility="{Binding ERLKZ,ElementName=TV,Converter={StaticResource bv}}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="10,0,0,0"  
                            IsEnabled="{Binding IsMaster}"
                           Click="FBResetCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-return.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=重置}}"></TextBlock>
                    </Grid>
                </WrapPanel>
                <WrapPanel  IsEnabled="{Binding ERLKZ,ElementName=TV,Converter={StaticResource not}}">
                    <Button Grid.Column="1" Height="20"  Width="Auto" Margin="10,0,0,0" 
                            Content="{Binding Source={Localization:Translate Word=回修}}"  Click="btnRepaire_Click"/>
                </WrapPanel>
                <WrapPanel  Grid.Row="0">
                    <Button Margin="10,0,0,0"  Content="{Binding Source={Localization:Translate Word=解除合投}}" Click="DeleteCommand"/>
                    <CheckBox IsChecked="{Binding IsCanDelete,ElementName=TV}" />
                </WrapPanel>
                <DR:TDRAUFTR  Grid.Column="0" Name="cDR" 
                                  Visibility="Collapsed" PrintType="OpenExcel" />
                <Button  Grid.Column="1"   Click="PrintCommand" Height="20" Margin="5,0,0,0" Width="Auto" 
                         Tag="YGRABFB"
                             Content="{Binding Source={Localization:Translate Word=查看启动}}" />
                <Button  Grid.Column="1"   Click="PrintCommand" Height="20" Margin="5,0,0,0" Width="Auto" 
                         Tag="YGRABFBWC"
                             Content="{Binding Source={Localization:Translate Word=查看确认}}" />
            </WrapPanel>
            <WrapPanel>
                <me:TAB50PR x:Name="cPR" 
                            EXAUF="{Binding EXTPROD,ElementName=TV}" 
                            DES="{Binding DES,ElementName=TV}" 
                             />
                <GD:TGDEXG dwReq="{Binding dwAB,ElementName=cPR}" 
                            dwGD="{Binding dwGD,ElementName=cGD}"                            
                           ABPSTKLG="{Binding ABPSTKLG,ElementName=TV}"  
                           ABPSOLLMENGE5="{Binding ABPSOLLMENGE5,ElementName=TV}"  
                           ABPSOLLMENGE7="{Binding ABPSOLLMENGE7,ElementName=TV}"   
                           IsAuto="False"
                           MaxHeight="150"/>
            </WrapPanel>
            <WrapPanel Visibility="Collapsed">
                <Button Grid.Column="1" Height="Auto"  Width="Auto" Margin="0,10,0,0" 
                        Visibility="{Binding IsGD,ElementName=TV,Converter={StaticResource bv}}"
                        Click="RefreshARTCommand" >
                    <Button.Content>
                        <WrapPanel>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=更改粗砂编码}}"/>

                            <WrapPanel  Margin="10,0,0,0" >
                                <TextBlock   Text="{Binding Source={Localization:Translate Word=选择纱线}}"/>
                                <GC:TSGS07
                                    ART="3"
                                     KEY="{Binding YARN,ElementName=TV}"
                                     IsEdit="True" 
                                   /> 
                            </WrapPanel>
                        </WrapPanel>
                    </Button.Content>
                </Button>
            </WrapPanel>
        </StackPanel>
        
        <PR:TRVRULES Grid.Row="1" Grid.Column="0" 
                     IsEnabled="{Binding ERLKZ,ElementName=TV,Converter={StaticResource not}}"
                    IsEdit="{Binding IsEdit,ElementName=TV}" 
                     Visibility="{Binding IsGD,ElementName=TV,Converter={StaticResource nbv}}"
                     Name="cRule"  ARTSTAGE="R"    
                     dwRule="{Binding dwRule,ElementName=TV}"
                     WH="{Binding WH,ElementName=TV}"
                    ORDERNUM="{Binding RULEKEY,ElementName=TV}"
                     IsZutei="{Binding IsZutei,ElementName=TV}" 
                     />
        <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <MU:TABMUVK   Grid.Column="0"
                          Name="cMUVK"
                          dwMU="{Binding dwMUD,ElementName=TV}"
                        ORDERNUM="{Binding AUF,ElementName=TV}"
                     />
            <GD:TGD713  Grid.Column="1"
                     Name="cGD"
                    FTAUTOGA="False"
                    AUFTYP="V"
                    ARTSTAGE="R" 
                    IsGridShow="True"
                     IsEdit="{Binding IsEdit,ElementName=TV}"
                    dwRule="{Binding dwRule,ElementName=TV}" 
                    IsGD="{Binding IsGD,ElementName=TV}" 
                    POSTYP="{Binding POSTYP,ElementName=TV}" 
                    ORDERNUM="{Binding KEY,ElementName=TV}"  
                    />  
        </Grid>
        
        <Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"   
              Visibility="{Binding IsGD,ElementName=TV,Converter={StaticResource bv}}"
              >
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <GB:TGLLG   Grid.Row="0" Grid.Column="0" Grid.RowSpan="2"
                    VerticalAlignment="Top"
                       IsAuto="{Binding IsGD,ElementName=TV}"
                       dwReq="{Binding dwGD,ElementName=cYGA}"
                      dwGD="{Binding dwGD,ElementName=cGD}"
                            />
            <GD:YARNA     Grid.Row="0" Grid.Column="1"  Grid.RowSpan="2"
                          FTAUTOSUM="True"
                          SKEY1="GAART"
                           IsAuto="{Binding IsGD,ElementName=TV}"
                          KEY1="QFREE"
                         Name="cYGA"  VerticalAlignment="Top"
                        dwReq="{Binding dwGD,ElementName=cYGD}"            
            />
            <Grid  Grid.Row="0" Grid.Column="2"  Grid.RowSpan="2">
                <Grid.RowDefinitions>
                    <RowDefinition   Height="1*" />
                    <RowDefinition   Height="1*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>

                <GD:Y3TGAAUF Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                      Name="cYGD"
                      EXTMU="SM"
                              IsAuto="{Binding IsGD,ElementName=TV}"
                      dwReq="{Binding dwGD,ElementName=cGD}"
                      POSTYP="{Binding POSTYP,ElementName=cGD}"  />
                <GD:XZUTEI   Grid.Row="1" Grid.Column="0"  
                              IsAuto="{Binding IsGD,ElementName=TV}"
                                 Name="cZU" VerticalAlignment="Top"
                                dwReq="{Binding dwGD,ElementName=cYGA}"            
                            />
                <GD:XGAAUF   Grid.Row="1" Grid.Column="1" 
                              IsAuto="{Binding IsGD,ElementName=TV}"
                             Name="cXGD"  VerticalAlignment="Top"
                            dwReq="{Binding dwGD,ElementName=cYGA}"            
            />
            </Grid>
        </Grid>
    </Grid>
</me:UIAB50>
